package com.prb.web.controller;

import com.prb.ip.filter.common.IpHolder;
import com.prb.web.service.impl.PoliceHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class HelloController {


    @Autowired
    private PoliceHelloService policeHelloService;

    @GetMapping("/ip/get")
    public String doRpc(String flag) {

        policeHelloService.sayHello("gg" , 100);

        String ip = IpHolder.self.getIp();

        System.out.println("ip is :" + ip);

        if(flag.equals("1")){
            System.out.println("do flag service 1");
        }else{

            System.out.println("do flag service not 1");
        }
        return "xixi";
    }


}
